#include "Core/Shared/Audio/BaseSoundManager.h"

#include "miniaudio.h"

class Emulator;

class MiniSoundManager : public BaseSoundManager
{
public:
    MiniSoundManager(Emulator *emu);
    ~MiniSoundManager() override;
    void PlayBuffer(int16_t *soundBuffer, uint32_t bufferSize, uint32_t sampleRate, bool isStereo) override;
    void Stop() override;
    void Pause() override;
    void ProcessEndOfFrame() override;

    string GetAvailableDevices() override;
    void SetAudioDevice(string deviceName) override;

    AudioStatistics GetStatistics() override;

private:
    Emulator *m_emulator;
    ma_device m_device;
    ma_device_config config;
    ma_pcm_rb m_ringBuffer;
};